package one.stand.response.essay;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.util.StringUtils;

import java.io.Serializable;
import java.util.Base64;
import java.util.Date;

/**
 * <p>
 * 获客文章访客数据
 * </p>
 *
 * @author luoyang
 * @since 2020-05-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="EssayVisitorsData对象", description="获客文章访客数据")
public class EssayVisitorsDataResponse implements Serializable {

    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "业务员")
    private String name;

    @ApiModelProperty(value = "微信用户")
    private String nickeName;

    @ApiModelProperty(value = "1海报 2名片 3 文章")
    private Integer source;

    @ApiModelProperty(value = "手机号")
    private String phone;

    @ApiModelProperty(value = "访问时间")
    private Date visitTime;

    @ApiModelProperty(value = "总次数")
    private Integer sumNum;

    @ApiModelProperty(value = "总时长")
    private Integer sumTimes;

    @ApiModelProperty(value = "转发次数")
    private Integer forwardfNum;


    @ApiModelProperty(value = "1:独占客户 2:共享客户")
    private Integer customerState;

    @ApiModelProperty(value = "客户id")
    private Integer customerId;

    private Integer ascriptionId;

//    public String getNickeName(String nickeName){
//        return StringUtils.isEmpty(nickeName) ? "" : new String(Base64.getDecoder().decode(nickeName));
//    }

    public void setNickeName(String nickeName){
        this.nickeName = StringUtils.isEmpty(nickeName) ? "" : new String(Base64.getDecoder().decode(nickeName));
    }

}
